Push NDEBUG handling down to zend_portability.h #16366
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As is,
NEDBUGis set to matchPHP_DEBUG(which matchesZEND_DEBUG) in php.h right before including assert.h; however, assert.h is already included at this point, so theNDEBUGhandling is useless. We push it down to zend_portability.h, where it has effect.The alternative would be to drop that code in php.h altogether, but that would make some test assumptions invalid. E.g. a build with
CFLAGS=-DNDEBUG ./configure --enable-debug-assertionswould fail internal_functions001.phpt, because the userlandPHP_DEBUGis true, but assertions would not be evaluated.